```html
<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>微服务熔断与降级技术详解</title>
    <link rel="stylesheet" href="https://cdn.staticfile.org/font-awesome/6.4.0/css/all.min.css">
    <link rel="stylesheet" href="https://cdn.staticfile.org/tailwindcss/2.2.19/tailwind.min.css">
    <link href="https://fonts.googleapis.com/css2?family=Noto+Serif+SC:wght@400;500;600;700&family=Noto+Sans+SC:wght@300;400;500;700&display=swap" rel="stylesheet">
    <script src="https://cdn.jsdelivr.net/npm/mermaid@latest/dist/mermaid.min.js"></script>
    <style>
        body {
            font-family: 'Noto Sans SC', Tahoma, Arial, Roboto, "Droid Sans", "Helvetica Neue", "Droid Sans Fallback", "Heiti SC", "Hiragino Sans GB", Simsun, sans-serif;
            color: #333;
            line-height: 1.6;
        }
        h1, h2, h3, h4 {
            font-family: 'Noto Serif SC', serif;
            font-weight: 600;
        }
        .hero-gradient {
            background: linear-gradient(135deg, #6e8efb 0%, #a777e3 100%);
        }
        .card-hover {
            transition: all 0.3s ease;
        }
        .card-hover:hover {
            transform: translateY(-5px);
            box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
        }
        .feature-icon {
            font-size: 2.5rem;
            color: #6e8efb;
            margin-bottom: 1rem;
        }
        .mermaid {
            background-color: white;
            padding: 1.5rem;
            border-radius: 0.5rem;
            box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
        }
        .mermaid-title {
            font-size: 1.25rem;
            margin-bottom: 1rem;
            color: #4a5568;
            font-weight: 600;
        }
        .tool-card {
            border-left: 4px solid #6e8efb;
        }
        .footer-link {
            transition: all 0.3s ease;
        }
        .footer-link:hover {
            color: #a777e3;
        }
    </style>
</head>
<body class="bg-gray-50">
    <!-- Hero Section -->
    <section class="hero-gradient text-white py-16 md:py-24">
        <div class="container mx-auto px-6">
            <div class="max-w-4xl mx-auto text-center">
                <h1 class="text-4xl md:text-5xl font-bold mb-6 leading-tight">构建高可用的微服务系统</h1>
                <p class="text-xl md:text-2xl mb-8 opacity-90">深入解析熔断与降级技术的实现方案</p>
                <div class="flex justify-center space-x-4">
                    <a href="#content" class="bg-white text-indigo-600 px-6 py-3 rounded-full font-medium hover:bg-gray-100 transition duration-300">
                        开始探索 <i class="fas fa-arrow-down ml-2"></i>
                    </a>
                    <a href="#comparison" class="border-2 border-white text-white px-6 py-3 rounded-full font-medium hover:bg-white hover:text-indigo-600 transition duration-300">
                        方案对比 <i class="fas fa-balance-scale ml-2"></i>
                    </a>
                </div>
            </div>
        </div>
    </section>

    <!-- Content Section -->
    <section id="content" class="py-16 bg-white">
        <div class="container mx-auto px-6 max-w-6xl">
            <div class="mb-12 text-center">
                <h2 class="text-3xl font-bold mb-4">微服务架构中的稳定性保障</h2>
                <p class="text-gray-600 max-w-3xl mx-auto">在分布式系统中，服务间的调用不可避免会出现延迟或失败。熔断与降级技术是确保系统稳定性的关键策略，能够防止级联故障，提升系统整体可靠性。</p>
            </div>

            <div class="grid md:grid-cols-3 gap-8 mb-16">
                <div class="bg-gray-50 p-8 rounded-lg card-hover text-center">
                    <div class="feature-icon">
                        <i class="fas fa-bolt"></i>
                    </div>
                    <h3 class="text-xl font-semibold mb-3">熔断机制</h3>
                    <p class="text-gray-600">当错误率超过阈值时自动切断服务调用，防止故障扩散，给系统恢复时间。</p>
                </div>
                <div class="bg-gray-50 p-8 rounded-lg card-hover text-center">
                    <div class="feature-icon">
                        <i class="fas fa-shield-alt"></i>
                    </div>
                    <h3 class="text-xl font-semibold mb-3">降级策略</h3>
                    <p class="text-gray-600">在服务不可用时提供备用方案，保证核心功能可用，提升用户体验。</p>
                </div>
                <div class="bg-gray-50 p-8 rounded-lg card-hover text-center">
                    <div class="feature-icon">
                        <i class="fas fa-chart-line"></i>
                    </div>
                    <h3 class="text-xl font-semibold mb-3">实时监控</h3>
                    <p class="text-gray-600">可视化展示系统健康状况，帮助快速定位问题，及时调整策略。</p>
                </div>
            </div>

            <!-- Hystrix -->
            <div class="mb-16">
                <div class="bg-white p-6 rounded-lg shadow-md tool-card mb-8">
                    <div class="flex items-center mb-4">
                        <img src="https://netflix.github.io/Hystrix/images/hystrix-logo-tagline-640.png" alt="Hystrix Logo" class="h-12 mr-4">
                        <h2 class="text-2xl font-bold">Hystrix</h2>
                    </div>
                    <p class="text-gray-700 mb-4">Netflix 开源的服务容错库，是微服务架构中最成熟的熔断实现方案之一。</p>
                    <div class="grid md:grid-cols-2 gap-6 mb-4">
                        <div>
                            <h3 class="font-semibold mb-2 text-indigo-600"><i class="fas fa-check-circle mr-2"></i>核心特性</h3>
                            <ul class="list-disc pl-5 text-gray-600">
                                <li class="mb-2">熔断器功能：自动监测并熔断故障服务</li>
                                <li class="mb-2">优雅降级：预定义降级逻辑</li>
                                <li class="mb-2">资源隔离：线程池/信号量隔离</li>
                                <li class="mb-2">实时监控：Hystrix Dashboard</li>
                            </ul>
                        </div>
                        <div>
                            <h3 class="font-semibold mb-2 text-indigo-600"><i class="fas fa-cogs mr-2"></i>适用场景</h3>
                            <ul class="list-disc pl-5 text-gray-600">
                                <li class="mb-2">Spring Cloud 微服务架构</li>
                                <li class="mb-2">需要成熟稳定解决方案的项目</li>
                                <li class="mb-2">需要详细监控和指标的项目</li>
                                <li class="mb-2">对 Java 生态有依赖的系统</li>
                            </ul>
                        </div>
                    </div>
                    <div class="bg-gray-50 p-4 rounded">
                        <h4 class="font-semibold mb-2 text-gray-700"><i class="fas fa-code mr-2"></i>示例代码片段</h4>
                        <pre class="bg-gray-800 text-gray-100 p-3 rounded text-sm overflow-x-auto"><code>@HystrixCommand(fallbackMethod = "defaultProducts")
public List&lt;Product&gt; getProducts() {
    // 调用可能失败的服务
    return productService.getAll();
}

public List&lt;Product&gt; defaultProducts() {
    // 降级逻辑
    return Collections.emptyList();
}</code></pre>
                    </div>
                </div>

                <!-- Resilience4j -->
                <div class="bg-white p-6 rounded-lg shadow-md tool-card mb-8">
                    <div class="flex items-center mb-4">
                        <img src="https://resilience4j.readme.io/image/logo.png" alt="Resilience4j Logo" class="h-12 mr-4">
                        <h2 class="text-2xl font-bold">Resilience4j</h2>
                    </div>
                    <p class="text-gray-700 mb-4">轻量级、功能丰富的容错库，专为 Java 8+ 设计，是 Hystrix 的现代替代方案。</p>
                    <div class="grid md:grid-cols-2 gap-6 mb-4">
                        <div>
                            <h3 class="font-semibold mb-2 text-indigo-600"><i class="fas fa-check-circle mr-2"></i>核心特性</h3>
                            <ul class="list-disc pl-5 text-gray-600">
                                <li class="mb-2">模块化设计：可按需选择功能</li>
                                <li class="mb-2">函数式编程：兼容 Java 8+</li>
                                <li class="mb-2">重试机制：自动重试失败操作</li>
                                <li class="mb-2">限流控制：防止系统过载</li>
                            </ul>
                        </div>
                        <div>
                            <h3 class="font-semibold mb-2 text-indigo-600"><i class="fas fa-cogs mr-2"></i>适用场景</h3>
                            <ul class="list-disc pl-5 text-gray-600">
                                <li class="mb-2">现代 Java 应用 (8+)</li>
                                <li class="mb-2">需要轻量级解决方案</li>
                                <li class="mb-2">需要灵活的功能组合</li>
                                <li class="mb-2">微服务或单体应用均可</li>
                            </ul>
                        </div>
                    </div>
                    <div class="bg-gray-50 p-4 rounded">
                        <h4 class="font-semibold mb-2 text-gray-700"><i class="fas fa-code mr-2"></i>示例代码片段</h4>
                        <pre class="bg-gray-800 text-gray-100 p-3 rounded text-sm overflow-x-auto"><code>// 创建熔断器配置
CircuitBreakerConfig config = CircuitBreakerConfig.custom()
    .failureRateThreshold(50)
    .waitDurationInOpenState(Duration.ofMillis(1000))
    .build();

// 包装服务调用
CircuitBreaker circuitBreaker = CircuitBreaker.of("productService", config);
Supplier&lt;List&lt;Product&gt;&gt; decorated = CircuitBreaker
    .decorateSupplier(circuitBreaker, productService::getAllProducts);</code></pre>
                    </div>
                </div>

                <!-- Sentinel -->
                <div class="bg-white p-6 rounded-lg shadow-md tool-card mb-8">
                    <div class="flex items-center mb-4">
                        <img src="https://sentinelguard.io/img/sentinel_colorful.png" alt="Sentinel Logo" class="h-12 mr-4">
                        <h2 class="text-2xl font-bold">Sentinel</h2>
                    </div>
                    <p class="text-gray-700 mb-4">阿里巴巴开源的流量控制组件，专注于高可用和高性能的服务防护。</p>
                    <div class="grid md:grid-cols-2 gap-6 mb-4">
                        <div>
                            <h3 class="font-semibold mb-2 text-indigo-600"><i class="fas fa-check-circle mr-2"></i>核心特性</h3>
                            <ul class="list-disc pl-5 text-gray-600">
                                <li class="mb-2">流量控制：QPS/并发数控制</li>
                                <li class="mb-2">熔断降级：基于响应时间/异常比例</li>
                                <li class="mb-2">系统保护：自适应流量控制</li>
                                <li class="mb-2">热规则配置：实时生效</li>
                            </ul>
                        </div>
                        <div>
                            <h3 class="font-semibold mb-2 text-indigo-600"><i class="fas fa-cogs mr-2"></i>适用场景</h3>
                            <ul class="list-disc pl-5 text-gray-600">
                                <li class="mb-2">阿里巴巴技术栈项目</li>
                                <li class="mb-2">需要精细化流量控制</li>
                                <li class="mb-2">高并发、高性能要求的系统</li>
                                <li class="mb-2">需要动态规则配置的项目</li>
                            </ul>
                        </div>
                    </div>
                    <div class="bg-gray-50 p-4 rounded">
                        <h4 class="font-semibold mb-2 text-gray-700"><i class="fas fa-code mr-2"></i>示例代码片段</h4>
                        <pre class="bg-gray-800 text-gray-100 p-3 rounded text-sm overflow-x-auto"><code>// 定义资源
@SentinelResource(value = "productService", blockHandler = "handleBlock")
public List&lt;Product&gt; getProducts() {
    return productService.getAll();
}

// 限流/降级处理
public List&lt;Product&gt; handleBlock(BlockException ex) {
    // 返回默认值或缓存数据
    return fallbackProducts();
}</code></pre>
                    </div>
                </div>

                <!-- Spring Cloud Circuit Breaker -->
                <div class="bg-white p-6 rounded-lg shadow-md tool-card mb-8">
                    <div class="flex items-center mb-4">
                        <img src="https://spring.io/images/projects/spring-cloud-circuit-breaker-logo-9a8b51ec2a59f2f8a0f5d0b1f5c5b1c3.svg" alt="Spring Cloud Circuit Breaker Logo" class="h-12 mr-4">
                        <h2 class="text-2xl font-bold">Spring Cloud Circuit Breaker</h2>
                    </div>
                    <p class="text-gray-700 mb-4">Spring Cloud 提供的抽象层，支持多种熔断器实现，统一了API使用方式。</p>
                    <div class="grid md:grid-cols-2 gap-6 mb-4">
                        <div>
                            <h3 class="font-semibold mb-2 text-indigo-600"><i class="fas fa-check-circle mr-2"></i>核心特性</h3>
                            <ul class="list-disc pl-5 text-gray-600">
                                <li class="mb-2">统一API：一致的使用方式</li>
                                <li class="mb-2">多实现支持：Hystrix/Resilience4j等</li>
                                <li class="mb-2">与Spring生态无缝集成</li>
                                <li class="mb-2">自动配置：简化使用</li>
                            </ul>
                        </div>
                        <div>
                            <h3 class="font-semibold mb-2 text-indigo-600"><i class="fas fa-cogs mr-2"></i>适用场景</h3>
                            <ul class="list-disc pl-5 text-gray-600">
                                <li class="mb-2">Spring Cloud 微服务</li>
                                <li class="mb-2">需要灵活切换熔断器实现</li>
                                <li class="mb-2">希望减少供应商锁定</li>
                                <li class="mb-2">已使用Spring生态的项目</li>
                            </ul>
                        </div>
                    </div>
                    <div class="bg-gray-50 p-4 rounded">
                        <h4 class="font-semibold mb-2 text-gray-700"><i class="fas fa-code mr-2"></i>示例代码片段</h4>
                        <pre class="bg-gray-800 text-gray-100 p-3 rounded text-sm overflow-x-auto"><code>// 使用CircuitBreakerFactory
@Autowired
private CircuitBreakerFactory circuitBreakerFactory;

public List&lt;Product&gt; getProducts() {
    return circuitBreakerFactory.create("productService")
        .run(productService::getAll, throwable -> fallbackProducts());
}</code></pre>
                    </div>
                </div>

                <!-- Nginx -->
                <div class="bg-white p-6 rounded-lg shadow-md tool-card">
                    <div class="flex items-center mb-4">
                        <img src="https://www.nginx.com/wp-content/uploads/2018/08/NGINX-logo-rgb-large.png" alt="Nginx Logo" class="h-12 mr-4">
                        <h2 class="text-2xl font-bold">Nginx</h2>
                    </div>
                    <p class="text-gray-700 mb-4">高性能的反向代理服务器，可在网络层面实现简单的熔断和降级功能。</p>
                    <div class="grid md:grid-cols-2 gap-6 mb-4">
                        <div>
                            <h3 class="font-semibold mb-2 text-indigo-600"><i class="fas fa-check-circle mr-2"></i>核心特性</h3>
                            <ul class="list-disc pl-5 text-gray-600">
                                <li class="mb-2">故障转移：自动切换备用服务器</li>
                                <li class="mb-2">限流控制：防止后端过载</li>
                                <li class="mb-2">健康检查：自动剔除故障节点</li>
                                <li class="mb-2">高性能：处理高并发请求</li>
                            </ul>
                        </div>
                        <div>
                            <h3 class="font-semibold mb-2 text-indigo-600"><i class="fas fa-cogs mr-2"></i>适用场景</h3>
                            <ul class="list-disc pl-5 text-gray-600">
                                <li class="mb-2">非Java技术栈系统</li>
                                <li class="mb-2">需要网络层的高可用方案</li>
                                <li class="mb-2">作为应用层熔断的补充</li>
                                <li class="mb-2">需要高性能反向代理</li>
                            </ul>
                        </div>
                    </div>
                    <div class="bg-gray-50 p-4 rounded">
                        <h4 class="font-semibold mb-2 text-gray-700"><i class="fas fa-code mr-2"></i>配置示例</h4>
                        <pre class="bg-gray-800 text-gray-100 p-3 rounded text-sm overflow-x-auto"><code>upstream backend {
    server backend1.example.com max_fails=3 fail_timeout=30s;
    server backend2.example.com backup;
    
    # 健康检查
    check interval=5000 rise=2 fall=3 timeout=1000;
}

server {
    location / {
        proxy_pass http://backend;
        # 连接失败时重试2次
        proxy_next_upstream error timeout http_500;
        proxy_next_upstream_tries 2;
    }
}</code></pre>
                    </div>
                </div>
            </div>
        </div>
    </section>

    <!-- Comparison Section -->
    <section id="comparison" class="py-16 bg-gray-50">
        <div class="container mx-auto px-6 max-w-6xl">
            <div class="mb-12 text-center">
                <h2 class="text-3xl font-bold mb-4">技术方案对比</h2>
                <p class="text-gray-600 max-w-3xl mx-auto">不同熔断降级方案的特性对比，帮助您选择最适合项目需求的工具</p>
            </div>

            <div class="bg-white rounded-lg shadow-md overflow-hidden mb-12">
                <div class="overflow-x-auto">
                    <table class="min-w-full divide-y divide-gray-200">
                        <thead class="bg-gray-50">
                            <tr>
                                <th scope="col" class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">特性</th>
                                <th scope="col" class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">Hystrix</th>
                                <th scope="col" class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">Resilience4j</th>
                                <th scope="col" class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">Sentinel</th>
                                <th scope="col" class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">Spring Cloud CB</th>
                                <th scope="col" class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">Nginx</th>
                            </tr>
                        </thead>
                        <tbody class="bg-white divide-y divide-gray-200">
                            <tr>
                                <td class="px-6 py-4 whitespace-nowrap text-sm font-medium text-gray-900">熔断功能</td>
                                <td class="px-6 py-4 whitespace-nowrap text-sm text-gray-500"><i class="fas fa-check text-green-500"></i></td>
                                <td class="px-6 py-4 whitespace-nowrap text-sm text-gray-500"><i class="fas fa-check text-green-500"></i></td>
                                <td class="px-6 py-4 whitespace-nowrap text-sm text-gray-500"><i class="fas fa-check text-green-500"></i></td>
                                <td class="px-6 py-4 whitespace-nowrap text-sm text-gray-500"><i class="fas fa-check text-green-500"></i></td>
                                <td class="px-6 py-4 whitespace-nowrap text-sm text-gray-500"><i class="fas fa-check text-green-500"></i></td>
                            </tr>
                            <tr>
                                <td class="px-6 py-4 whitespace-nowrap text-sm font-medium text-gray-900">降级功能</td>
                                <td class="px-6 py-4 whitespace-nowrap text-sm text-gray-500"><i class="fas fa-check text-green-500"></i></td>
                                <td class="px-6 py-4 whitespace-nowrap text-sm text-gray-500"><i class="fas fa-check text-green-500"></i></td>
                                <td class="px-6 py-4 whitespace-nowrap text-sm text-gray-500"><i class="fas fa-check text-green-500"></i></td>
                                <td class="px-6 py-4 whitespace-nowrap text-sm text-gray-500"><i class="fas fa-check text-green-500"></i></td>
                                <td class="px-6 py-4 whitespace-nowrap text-sm text-gray-500"><i class="fas fa-check text-green-500"></i></td>
                            </tr>
                            <tr>
                                <td class="px-6 py-4 whitespace-nowrap text-sm font-medium text-gray-900">限流控制</td>
                                <td class="px-6 py-4 whitespace-nowrap text-sm text-gray-500"><i class="fas fa-times text-red-500"></i></td>
                                <td class="px-6 py-4 whitespace-nowrap text-sm text-gray-500"><i class="fas fa-check text-green-500"></i></td>
                                <td class="px-6 py-4 whitespace-nowrap text-sm text-gray-500"><i class="fas fa-check text-green-500"></i></td>
                                <td class="px-6 py-4 whitespace-nowrap text-sm text-gray-500">依赖实现</td>
                                <td class="px-6 py-4 whitespace-nowrap text-sm text-gray-500"><i class="fas fa-check text-green-500"></i></td>
                            </tr>
                            <tr>
                                <td class="px-6 py-4 whitespace-nowrap text-sm font-medium text-gray-900">实时监控</td>
                                <td class="px-6 py-4 whitespace-nowrap text-sm text-gray-500"><i class="fas fa-check text-green-500"></i></td>
                                <td class="px-6 py-4 whitespace-nowrap text-sm text-gray-500">需要扩展</td>
                                <td class="px-6 py-4 whitespace-nowrap text-sm text-gray-500"><i class="fas fa-check text-green-500"></i></td>
                                <td class="px-6 py-4 whitespace-nowrap text-sm text-gray-500">依赖实现</td>
                                <td class="px-6 py-4 whitespace-nowrap text-sm text-gray-500">有限</td>
                            </tr>
                            <tr>
                                <td class="px-6 py-4 whitespace-nowrap text-sm font-medium text-gray-900">动态配置</td>
                                <td class="px-6 py-4 whitespace-nowrap text-sm text-gray-500">有限</td>
                                <td class="px-6 py-4 whitespace-nowrap text-sm text-gray-500"><i class="fas fa-check text-green-500"></i></td>
                                <td class="px-6 py-4 whitespace-nowrap text-sm text-gray-500"><i class="fas fa-check text-green-500"></i></td>
                                <td class="px-6 py-4 whitespace-nowrap text-sm text-gray-500">依赖实现</td>
                                <td class="px-6 py-4 whitespace-nowrap text-sm text-gray-500">需要reload</td>
                            </tr>
                            <tr>
                                <td class="px-6 py-4 whitespace-nowrap text-sm font-medium text-gray-900">轻量级</td>
                                <td class="px-6 py-4 whitespace-nowrap text-sm text-gray-500"><i class="fas fa-times text-red-500"></i></td>
                                <td class="px-6 py-4 whitespace-nowrap text-sm text-gray-500"><i class="fas fa-check text-green-500"></i></td>
                                <td class="px-6 py-4 whitespace-nowrap text-sm text-gray-500"><i class="fas fa-check text-green-500"></i></td>
                                <td class="px-6 py-4 whitespace-nowrap text-sm text-gray-500">依赖实现</td>
                                <td class="px-6 py-4 whitespace-nowrap text-sm text-gray-500"><i class="fas fa-check text-green-500"></i></td>
                            </tr>
                            <tr>
                                <td class="px-6 py-4 whitespace-nowrap text-sm font-medium text-gray-900">语言支持</td>
                                <td class="px-6 py-4 whitespace-nowrap text-sm text-gray-500">Java</td>
                                <td class="px-6 py-4 whitespace-nowrap text-sm text-gray-500">Java</td>
                                <td class="px-6 py-4 whitespace-nowrap text-sm text-gray-500">多语言</td>
                                <td class="px-6 py-4 whitespace-nowrap text-sm text-gray-500">Java</td>
                                <td class="px-6 py-4 whitespace-nowrap text-sm text-gray-500">语言无关</td>
                            </tr>
                        </tbody>
                    </table>
                </div>
            </div>

            <div class="mb-12">
                <h3 class="text-2xl font-bold mb-6 text-center">技术选型建议</h3>
                <div class="grid md:grid-cols-3 gap-6">
                    <div class="bg-white p-6 rounded-lg shadow-md">
                        <div class="text-indigo-600 text-3xl mb-4">
                            <i class="fas fa-project-diagram"></i>
                        </div>
                        <h4 class="font-semibold text-lg mb-3">Spring Cloud 项目</h4>
                        <p class="text-gray-600">推荐使用 Spring Cloud Circuit Breaker + Resilience4j 组合，既保持与 Spring 生态的兼容性，又能获得现代熔断器特性。</p>
                    </div>
                    <div class="bg-white p-6 rounded-lg shadow-md">
                        <div class="text-indigo-600 text-3xl mb-4">
                            <i class="fas fa-tachometer-alt"></i>
                        </div>
                        <h4 class="font-semibold text-lg mb-3">高性能要求</h4>
                        <p class="text-gray-600">考虑 Sentinel 或 Nginx 方案，Sentinel 提供更精细的控制，Nginx 则在网络层提供高性能防护。</p>
                    </div>
                    <div class="bg-white p-6 rounded-lg shadow-md">
                        <div class="text-indigo-600 text-3xl mb-4">
                            <i class="fas fa-code-branch"></i>
                        </div>
                        <h4 class="font-semibold text-lg mb-3">多语言环境</h4>
                        <p class="text-gray-600">Sentinel 或 Nginx 更适合多语言微服务架构，前者提供SDK支持，后者完全语言无关。</p>
                    </div>
                </div>
            </div>

            <div class="bg-white p-8 rounded-lg shadow-md">
                <h3 class="text-2xl font-bold mb-6 text-center">熔断与降级架构图</h3>
                <div class="mermaid">
                    <div class="mermaid-title">微服务熔断降级流程</div>
                    <div class="mermaid-diagram">
                        graph TD
                            A[客户端请求] --> B{健康检查}
                            B -->|服务正常| C[处理请求]
                            B -->|服务异常| D[熔断器触发]
                            D --> E[执行降级逻辑]
                            E --> F[返回降级结果]
                            C --> G[返回正常结果]
                            D --> H[监控告警]
                            H --> I[运维处理]
                    </div>
                </div>
            </div>
        </div>
    </section>

    <!-- Footer -->
    <footer class="bg-gray-900 text-white py-8">
        <div class="container mx-auto px-6">
            <div class="flex flex-col md:flex-row justify-between items-center">
                <div class="mb-4 md:mb-0">
                    <h3 class="text-xl font-semibold">技术小馆</h3>
                    <p class="text-gray-400 mt-1">专注技术分享与学习</p>
                </div>
                <div>
                    <a href="http://www.yuque.com/jtostring" class="footer-link text-gray-300 hover:text-white">
                        <i class="fas fa-globe mr-2"></i> www.yuque.com/jtostring
                    </a>
                </div>
            </div>
            <div class="border-t border-gray-800 mt-6 pt-6 text-center text-gray-400 text-sm">
                &copy; 2023 技术小馆. 保留所有权利.
            </div>
        </div>
    </footer>

    <script>
        mermaid.initialize({
            startOnLoad: true,
            theme: 'default',
            flowchart: {
                useMaxWidth: true,
                htmlLabels: true,
                curve: 'basis'
            }
        });
    </script>
</body>
</html>
```